<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'basic';
$return=array();
if($_RQ['op']=='basic'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		$this->plugin_setting('basic',$postdata);
		exi('设置成功');
	}
	$footernav =array(
		array('title'=>'首页','icon'=>'icon-shouye','action'=>'jy_newcar/index/'),
		array('title'=>'经销商代理','icon'=>'icon-dingdan','action'=>'jy_newcar/area.index/'),
		array('title'=>'奖励统计','icon'=>'icon-yiban','action'=>'jy_newcar/area.commission/'),
		array('title'=>'奖励明细','icon'=>'icon-dixiaofei','action'=>'jy_newcar/area.orderfee/'),
		array('title'=>'我的团队','icon'=>'icon-paihao0','action'=>'jy_newcar/area.down/'),
	);	
	$return['item']=$this->plugin_setting('basic');
	$return['item']['afooternav']=$return['item']['afooternav']?:$footernav;
	$aitip='启用后才生效！';
	$htmls=array(
		'type'=>'edit',
		'desc'=>'参数设置',
		'tabs'=>$tabs,
		'edit_tab'=>true,
		'edits'=>array(
			array(
				'title'=>'经销商设置',
				'list'=>array(
					array('type'=>'tip','title'=>$aitip),
					array('type'=>'select','name'=>'demoareaid','title'=>'默认经销商','options'=>'areas','option_value'=>'mid'),	
					array('type'=>'unitstring','unit'=>'台','name'=>'area_num','title'=>'卖车N台可申请代理'),		
					array('type'=>'unitstring','unit'=>'元/台','name'=>'area_fee','title'=>'经销商代理收益/台','help'=>'凡是在经销商代理区域范围的提车，经销商代理有N元收益'),	
					array('type'=>'link','from'=>'action','title'=>'二维码跳转链接','name'=>'share_link','help'=>'默认跳转到商城首页，指定链接后，跳转到指定页面！'),					
				)
			),
			array(
				'title'=>'底部导航',
					'list'=>array(
								array('type'=>'array','name'=>'afooternav','add_tip'=>'添加一个底部导航',
									'list'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航图标'),
										array('type'=>'string','name'=>'action','title'=>'导航链接'),							
									),
									'details'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航图标','help'=>'图标，例如：icon-shouye'),							
										array('type'=>'link','name'=>'action','from'=>'action','title'=>'导航链接'),
									)
								),
					)
			),
		)
	);
	$return['areas']=pdo_getall('jy_newcar_member',array('uniacid'=>$_SESSION['uniacid'],'is_area'=>'1'),array('mid','title'),'mid');
	$return['become']=array('0'=>'无条件','1'=>'人工审核');
	$return['leveltype']=$this->level_up_types;
	$return['otherfee_types']=$this->model('model')->otherfee_types();
	$return['withdraw']=$this->pay_types;
	$return['commissiontype']=$this->commission_types;
	$return['is']=array('0'=>'否','1'=>'是');
	$return['level']=$this->level_types;
	$return['gift_type']=$this->gift_type;
	$return['levelfee_type']=$this->levelfee_type;
	$return['pay_type']=get_pay_types();
	$return['htmls']=$htmls;
	exi($return);
}